[#import "/framework/JGP.htm"  as JGP]
<!--
项目   glSystem
作者   fdp
时间   2018/8/4
-->
[@JGP.head "Title"/]
[@JGP.body]

<!--<jgp-hidden _id="hide" _value='${meetingID}'></jgp-hidden>-->


<jgp-div slot="2-1" _row="['8','*']" _aux="true">
    <jgp-div slot="1-1" _col="['*','*','*']" _aux="false">
        <jgp-btn slot="1-1" _margin="5" _fn="addUsersList">添加人员列表</jgp-btn>
    </jgp-div>
    <jgp-query  _target="grid" _id="query" _auto="false" _page_size="4"></jgp-query>
    <jgp-grid _id="grid"  slot="2-1" _record_tools="[{'icon':'times-rectangle','tip':'删除','fn':'removeJoinUser'}]"
              _index="true"></jgp-grid>

</jgp-div>

[/@JGP.body]

[@JGP.foot]
<script>
    //自动加载查参加会议的人
    JGP.$onload(queryJoinMeetUsers())
    function queryJoinMeetUsers() {

        var meetingID = '${meetingID}';

        JGP.grid('grid').load("/glMeeting/relationTableApiController/queryJoinMeetUsers/" + meetingID)
    }
    //添加人员列表
    function addUsersList(re) {
        var id = '${meetingID}';
        var config = {
            url: '/glMeeting/relationTableController/addUsersList/' + id,
            title: "添加人员列表",
            callback: function (res) {
                // console.log(res)
                if (res == true) {
                    window.location.reload();
                }
            },
            width: '1000px',
            height: '600px'
        }
        JGP.$dialog(config)
    }


    //删除参加会议的人
    function removeJoinUser(re) {
        var meetingID = '${meetingID}';
        JGP.$confirm("是否确认删除",function () {
        JGP.$post('/glMeeting/relationTableApiController/removeJoinUser',{id:re.back.id,meetingID:meetingID},function (res) {
            JGP.$alert("删除成功")
            if (res.flag==true) {
                window.location.reload();
            }
        })
        })
    }
</script>

[/@JGP.foot]